﻿using System;


namespace advadev.DataStorage
{

    /// <summary>
    /// Represents a service data storage
    /// </summary>
    sealed public class ServiceDataStorage : DataStorageBase
    {

        /// <summary>
        /// Initializes a new instance of the ServiceDataStorage class by the
        /// given parameter
        /// </summary>
        /// <param name="applicationKey">
        /// Application key
        /// </param>
        /// <param name="endpointConfigurationName">
        /// Endpoint configuration name
        /// </param>
        /// <param name="serviceUserName">
        /// Service user name
        /// </param>
        /// <param name="servicePassword">
        /// Service password
        /// </param>
        /// <exception cref="ArgumentException">
        /// Will be thrown if the application key is empty or null
        /// </exception>
        /// <exception cref="ArgumentException">
        /// Will be thrown if the endpoint configuration is invalid
        /// </exception>
        public ServiceDataStorage(string applicationKey, string endpointConfigurationName, string serviceUserName, string servicePassword)
            : this(applicationKey, endpointConfigurationName, serviceUserName, servicePassword, null, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of the ServiceDataStorage class by the
        /// given parameter
        /// </summary>
        /// <param name="applicationKey">
        /// Application key
        /// </param>
        /// <param name="endpointConfigurationName">
        /// Endpoint configuration name
        /// </param>
        /// <param name="serviceUserName">
        /// Service user name
        /// </param>
        /// <param name="servicePassword">
        /// Service password
        /// </param>
        /// <param name="administratorUserName">
        /// Administrator user name
        /// </param>
        /// <param name="administratorPassword">
        /// Administrator password
        /// </param>
        /// <exception cref="ArgumentException">
        /// Will be thrown if the application key is empty or null
        /// </exception>
        /// <exception cref="ArgumentException">
        /// Will be thrown if the endpoint configuration is invalid
        /// </exception>
        public ServiceDataStorage(string applicationKey, string endpointConfigurationName, string serviceUserName, string servicePassword, string administratorUserName, string administratorPassword)
            : base(applicationKey, new GenericEntityServiceDataStorage(applicationKey, endpointConfigurationName, serviceUserName, servicePassword, administratorUserName, administratorPassword))
        {
        }

    }

}
